package com.jd.sunny.exception;

/**
 * @author :Sun Lin
 * @ClassName:ExceptionTemplate
 * @Description:
 * @date :2012-9-10
 */
public class ExceptionTemplate extends Exception {

    /**
     * 数字代码code
     */
    public int code = 0;
    /**
     * 英文名称
     */
    public String name = "";
    /**
     * 描述
     */
    public String description = "";

    public ExceptionTemplate() {

    }

    /**
     * 构造方法
     *
     * @param code
     * @param message
     */
    public ExceptionTemplate(int code, String name) {
        super();
        this.code = code;
        this.name = name;
    }

    /**
     * 构造方法
     *
     * @param message
     * @param description
     */
    public ExceptionTemplate(String name, String description) {
        super();
        this.name = name;
        this.description = description;
    }

    /**
     * 构造方法
     *
     * @param code
     * @param message
     * @param description
     */
    public ExceptionTemplate(int code, String name, String description) {
        super();
        this.code = code;
        this.name = name;
        this.description = description;
    }

    public ExceptionTemplate(ExceptionEnum exceptionEnum) {
        super();
        this.code = exceptionEnum.toCode();
        this.name = exceptionEnum.toName();
        this.description = exceptionEnum.toDescription();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }


}
